package com.designpatterns.observerpattern;

public class BinaryObserver extends Observer
{

	public BinaryObserver(Subject subject)
	{
		this.subject = subject;
		this.subject.attach(this);
	}

	// 将state转化为二进制
	@Override
	public void update()
	{
		System.out.println("Binary String: " + Integer.toBinaryString(subject.getState()));
	}

}
